import {requestClient} from "#/api/request";


/**
 * 获取BOM 列表
 */
export async function getSpuBom(params: any) {
  return requestClient.get('/admin/v2.SpuBom/index',params);
}


/**
 * 列表 删除
 */
export async function spuBomDel(params: any) {
  return requestClient.delete('/admin/v2.SpuBom/del',params,{responseReturn:'raw'});
}



/**
 * 列表 审核
 */
export async function spuBomApproval(params: any) {
  return requestClient.post('/admin/v2.SpuBom/approval',params,{responseReturn:'raw'});
}


/**
 * 列表 反审
 */
export async function spuBomAgainst(params: any) {
  return requestClient.post('/admin/v2.SpuBom/against',params,{responseReturn:'raw'});
}


/**
 * 列表导出生产BOM单
 */
export async function mergerExportMaterialBill(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/mergerExportMaterialBill',params,{responseReturn: 'body',responseType: 'blob'});
}


/**
 * 详细页
 */
export async function spuBomEdit(params: any) {
  return requestClient.get('/admin/v2.SpuBom/edit',params);
}

/**
 * 列表 同步小蜜蜂
 */
export async function syncToXmf(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/syncToXmf',params,{responseReturn:'raw'});
}


/**
 * 导出当前
 */
export async function SpuBomExport(params: any) {
  return requestClient.post('/admin/v2.SpuBom/exportBom',params,{responseReturn: 'body',responseType: 'blob',
    headers: {  Accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',}
  });
}

/**
 * 保存
 */
export async function insertBomApi(params: any) {
  return requestClient.post('/admin/v2.SpuBom/add',params,{responseReturn:'raw'});
}

/**
 * 保存
 */
export async function editBomApi(params: any) {
  return requestClient.post('/admin/v2.SpuBom/edit',params,{responseReturn:'raw'});
}


/**
 *  获取物料表
 */
export async function getMaterial(params: any) {
  return requestClient.get('/admin/MaterialSku/getMaterialSkuindex',params,);
}



/**
 *  补充数据
 */
export async function editProdInfo(params: any) {
  return requestClient.post('/admin/v2.SpuBom/editProdInfo',params,{responseReturn:'raw'});
}


/**
 *  获取工序
 */
export async function processIndex(params: any) {
  return requestClient.get('/admin/Process/index',params,);
}

/**
 *  工作台- 获取总览
 */
export async function getNeedPurchaseList(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getNeedPurchaseList',params,{responseReturn:'raw'});
}

/**
 *  工作台- 获取已绑定采购单
 */
export async function get_purchase_info_api(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/get_purchase_info_api',params,{responseReturn:'raw'});
}


/**
 *  工作台- 获取待绑定
 */
export async function getInsertPurchaseBomFormApi(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getInsertPurchaseBomFormApi',params,{responseReturn:'raw'});
}

/**
 *  工作台- 获取采购员
 */
export async function getPurchaser(params: any) {
  return requestClient.post('/admin/auth.admin/index',params,{responseReturn:'raw'});
}



/**
 *  工作台- 新增绑定
 */
export async function confirmSelect(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/confirmSelect',params,{responseReturn:'raw'});
}


/**
 *  工作台- 解除绑定
 */
export async function  del_purchase_bind_api(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/del_purchase_bind_api',params,{responseReturn:'raw'});
}


/**
 *  工作台-获取物料采购列表
 */
export async function  getToPurchaseList(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getToPurchaseList',params,{responseReturn:'raw'});
}

/**
 *  工作台-获取下单方
 */
export async function  getCompanyList() {
  return requestClient.get('/admin/purchase/getCompanyList',);
}


/**
 *  工作台-下单
 */
export async function createOrder(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/createOrder', params, {responseReturn: 'raw'});
}

/**
 *  工作台-获取生产发料列表
 */
export async function  getSendMaterialData(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getSendMaterialData',params,{responseReturn:'raw'});
}

/**
 *  工作台-导出
 */
export async function exportMaterialBill(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/exportMaterialBill',params,{responseReturn: 'raw',responseType: 'blob',
    headers: {  Accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',}
  });
}
/**
 *  工作台-获取生产发料列表
 */
export async function  getProductSnApi(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getProductSn',params,{responseReturn:'raw'});
}


/**
 *  工作台-获取生产发料列表
 */
export async function  CreateSendOrder(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/CreateSendOrder',params,{responseReturn:'raw'});
}


/**
 *  工作台-获取生产退料
 */
export async function  getReturnMaterialData(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getReturnMaterialData',params,{responseReturn:'raw'});
}


/**
 *  工作台-确认退料
 */
export async function  CreateReturnOrder(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/CreateReturnOrder',params,{responseReturn:'raw'});
}

/**
 *  工作台-获取工序采购下单
 */
export async function  getToProcessPurchaseList(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getToProcessPurchaseList',params,{responseReturn:'raw'});
}



/**
 *  工作台-工序采购下单
 */
export async function  createProcessPurchase(params: any) {
  return requestClient.post('/admin/ProcessPurchase/add',params,{responseReturn:'raw'});
}

/**
 *  工作台-获取拆解列表
 */
export async function getRevicedList(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/getRevicedList',params,{responseReturn:'raw'});
}


/**
 *  工作台-拆解
 */
export async function splitOrder(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/splitOrder',params,{responseReturn:'raw'});
}



/**
 *  工作台-撤回拆单
 */
export async function notsplitOrder(params: any) {
  return requestClient.post('/admin/v2.SpuBomWork/notsplitOrder',params,{responseReturn:'raw'});
}



/**
 * 获取人员类型
 *
 */
export async function AdminGoodsCategory(params: any) {
  return requestClient.get('/admin/AdminGoodsCategory/index', params)
}

